libxl, xl: fix bootloader immediate console attach
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 May 2012 13:45:42 +0000 (14:45 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 May 2012 13:45:42 +0000 (14:45 +0100)
commit2ea83794a601c3598dec43443a18863c7ac1317f
tree46016cd6c78a644351f0418dcb4e6b3cdac2662d
parenta836d6543e0b417e147f01950e4fccfdc87fc449
libxl, xl: fix bootloader immediate console attach

Fix bugs related to console handling:

 * In libxl_primary_console_exec, if libxl__domain_type fails, do
   not abort, but instead log and return an error.  This can occur
   if the domid is invalid.

 * In xl's autoconnect_console, rename the ctx formal parameter so
   that when postfork creates a new ctx and puts it in the global ctx,
   we don't end up using the old one (via the formal parameter which
   has shadowed the global).

 * In xl's autoconnect_console, pass the domid from the event
   to libxl_primary_console_exec, rather than using the global domid
   (which has not yet been set, since it is only set at completion
   of the ao).

This causes xl create -c to once more work with pygrub.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/xl_cmdimpl.c